package com.lnsf.bookstore.system.role.dao;

import com.lnsf.bookstore.system.role.vo.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface RoleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

	List<Role> findRoleListByUserId(Integer user_id);

	/**
	 * 根据用户Id和角色名称统计
	 * @param userId
	 * @param name
	 * @return
	 */
	long countByUserIdAndName(@Param("userId") Integer userId, @Param("name") String name);

	List<Role> selectAll(Map<String, Object> map);

	List<Role> selectLevel();

	int deleteBatch(Object[] id);
}